//
//  pdnewsxqTableViewCell.m
//  BAOASystem
//
//  Created by michael on 2018/3/6.
//  Copyright © 2018年 czd. All rights reserved.
//

#import "pdnewsxqTableViewCell.h"

@implementation pdnewsxqTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {

  _label1 = [[UILabel alloc]init];
  _label1.numberOfLines = 0;
    _label1.frame = CGRectZero;
    _label1.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label1 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label1];
    
         _label2 = [[UILabel alloc]init];
         _label2.numberOfLines = 0;
    _label2.frame = CGRectZero;
    _label2.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label2 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2];
    
                _label3 = [[UILabel alloc]init];
                _label3.numberOfLines = 0;
    _label3.frame = CGRectZero;
    _label3.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label3 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label3];
    
                 _label4 = [[UILabel alloc]init];
                                 _label4.numberOfLines = 0;

    _label4.frame = CGRectZero;
    _label4.textColor = [UIColor colorWithHexString:@"a1a1a1"];
      [_label4 setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label4];
   _label1xq = [[UILabel alloc]init];
    _label1xq.frame = CGRectZero;
    _label1xq.numberOfLines = 0;
    _label1xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label1xq setFont:[UIFont systemFontOfSize:13]];
      
       [self.contentView addSubview:_label1xq];
    
         _label2xq = [[UILabel alloc]init];
    _label2xq.frame = CGRectZero;
                                     _label2xq.numberOfLines = 0;

    _label2xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label2xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label2xq];
    
                _label3xq = [[UILabel alloc]init];
            _label3xq.numberOfLines = 0;

    _label3xq.frame = CGRectZero;
    _label3xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label3xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label3xq];
    
                 _label4xq = [[UILabel alloc]init];
    _label4xq.frame = CGRectZero;
    _label4xq.numberOfLines = 0;
                _label4xq.numberOfLines = 0;

    _label4xq.textColor = [UIColor colorWithHexString:@"484848"];
      [_label4xq setFont:[UIFont systemFontOfSize:13]];
       [self.contentView addSubview:_label4xq];
}

return self;

}
- (void)layoutSubviews{

[super layoutSubviews];

   _label1.frame = CGRectMake(0, 0, 120, 32);
  
     CGFloat height = [OAToolBox sizebyText:_dic[@"keywords"] font:13 minsWidth:120];

     _label1xq.frame = CGRectMake(_label1.right, 0, kScreenWidth-_label1.width, height);
    _label2xq.frame = CGRectMake(_label1.right, _label1xq.bottom, kScreenWidth-_label1.width, 32);
    _label3xq.frame = CGRectMake(_label1.right, _label2xq.bottom, kScreenWidth-_label1.width, 32);

  _label2.frame = CGRectMake(0, _label1xq.bottom, 120, 32);
    _label3.frame = CGRectMake(0, _label2.bottom, 120, 32);

    _label1.text = NSLocalizedString(@"商品详情-关键字", nil);
    _label2.text = NSLocalizedString(@"商品详情-所属分类", nil);
    _label3.text = NSLocalizedString(@"商品详情-计量单位", nil);

    _label1xq.text = _dic[@"keywords"];
    _label2xq.text = _dic[@"category"];
    _label3xq.text = _dic[@"countUnit"];
    if([[NSString stringWithFormat:@"%@",_dic[@"isPrice"]]isEqualToString:@"0"]){
 _label4xq.frame = CGRectMake(_label1.right, _label3xq.bottom, kScreenWidth-_label1.width, 32);

   _label4.frame = CGRectMake(0, _label3.bottom, 120, 32);

  _label4.text = NSLocalizedString(@"商品详情-价格类型", nil);
   _label4xq.text = NSLocalizedString(@"商品详情-价格面议", nil);
}

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
